﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 第二次作业
{
    public class creditAccount : Account
    {
        public int creditLimit { get; protected set; }
        public decimal balance { get; protected set; }
        public creditAccount(string id,string userName,string password,int creditLimit, int balance)
        {
            this.id = id;
            this.userName = userName;
            this.password = password;
            this.creditLimit = creditLimit;
            this.balance = balance;
        }

        public void fetch(decimal num)
        {
            if (balance >= num)
            {
                balance = balance - num;
            }
            else
            {
                Console.WriteLine("余额不足");
            }
        }
    }
    public class BigMoneyArgs : EventArgs
    {
        public Account Account { get; }
        public decimal Amount { get; }

        public BigMoneyArgs(Account account, decimal amount)
        {
            Account = account;
            Amount = amount;
        }
    }
}
